/**
 * 底部导航
 */
function showNav(cname) {
    //创建导航标签
    const nav = document.createElement('nav');
    nav.className = 'nav'
    nav.innerHTML = `
        <a href="./home.html" class="${cname === 'home' ? 'active' : ''}">
            <span class="iconfont icon-shouye"></span>
            <p>首页</p>
        </a>

        <a href="./motion.html" class="${cname === 'motion' ? 'active' : ''}">
            <span class="iconfont icon-bianzubeifen "></span>
            <p>运动</p>
        </a>

        <a href="./circle.html" class="${cname === 'circle' ? 'active' : ''}">
            <span class="iconfont icon-pinglun 
            "></span>
            <p>圈子</p>
        </a>

        <a href="./my.html" class="${cname === 'my' ? 'active' : ''}">
            <span class="iconfont icon-31dianzan"></span>
            <p>我的</p>
        </a>
    `

    //添加到body中
    document.body.append(nav)
}


/** 
 * 
 * 顶部导航
*/
function showTop(cname) {

    const div = document.createElement("div")
    div.className = "nav-top"
    div.innerHTML = `
        <a href="./sport.html" class="${cname === 'sport' ? 'active-a' : ''}">跑步</a>
        <a href="./Cycling.html" class="${cname === 'Cycling' ? 'active-a' : ''}">骑行</a>
        <a href="./course.html"class="${cname === 'course' ? 'active-a' : ''}">课程训练</a>
    `
    document.body.prepend(div)
}
module.exports = {
    showNav,
    showTop
}